<?php
namespace Home\Controller;
use Think\Controller;
class DetailController extends Controller {

  public function index(){
      $id=intval($_GET[id]);
     if(!$id || $id<0) {
            return $this->error("ID不合法");
        }
    $news =  D("News")->find($id);
    if(!$news || $news['status'] != 1) {
            return $this->error("ID不存在或者资讯被关闭");
        }
     $content=D("NewsContent")->find($id);
     $news['content'] = htmlspecialchars_decode($content['content']);   
     $this->assign('news', $news);  
  	$this->display();
  }



	}